import java.rmi.RemoteException;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.swing.JOptionPane;
import javax.swing.UIManager;

import cmpe273.classproject.server.service.MovieServiceImplProxy;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

public class Main extends javax.swing.JFrame {
    MovieServiceImplProxy proxy = new MovieServiceImplProxy();
    /** Creates new form HomeScreen */
    public Main() {
    	try {
		UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
	} catch (Throwable e) {
	}
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        manageMembersBtn = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        manageMoviesBtn = new javax.swing.JButton();
        jPasswordField1 = new javax.swing.JPasswordField();
        jTextField1 = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton2.setEnabled(false);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Vido Library Management");

        manageMembersBtn.setText("Manage members");
        manageMembersBtn.setEnabled(false);
        manageMembersBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                manageMembersBtnActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
        jLabel1.setText("Video Library Management");

        manageMoviesBtn.setText("Manage movies");
        manageMoviesBtn.setEnabled(false);
        manageMoviesBtn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                manageMoviesBtnActionPerformed(evt);
            }
        });

        jLabel2.setText("Admin login");

        jLabel3.setText("E-mail:");

        jLabel4.setText("Password:");

        jButton1.setText("Login");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setText("Log out");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(98, 98, 98)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 388, Short.MAX_VALUE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(117, 117, 117)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton2)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(112, 112, 112)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jLabel4)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jPasswordField1)
                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel2)
                            .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(27, 27, 27)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel3))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addComponent(jButton1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton2)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>

    private void manageMembersBtnActionPerformed(java.awt.event.ActionEvent evt) {
        new AllSimple().setVisible(true);
    }

    private void manageMoviesBtnActionPerformed(java.awt.event.ActionEvent evt) {
        new AllMovies().setVisible(true);
    }

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    Pattern pEmailchecker = Pattern.compile("^[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+.[a-zA-Z]{2,6}$");
    	Matcher m5 = pEmailchecker.matcher(jTextField1.getText());
    	boolean emailchecker = m5.matches();
    	if(emailchecker) {
    	String pw = new String(jPasswordField1.getPassword());
    	try {
			if(proxy.login(jTextField1.getText(), pw)) {
				manageMembersBtn.setEnabled(true);
				manageMoviesBtn.setEnabled(true);
				jButton2.setEnabled(true);
				jButton1.setEnabled(false);
				jTextField1.setEnabled(false);
				jPasswordField1.setEnabled(false);
			} else
				JOptionPane.showMessageDialog(this, "Username (e-mail) or password was wrong.");
		} catch (RemoteException e) {
			JOptionPane.showMessageDialog(this, "Connection to server failed, try again later.");
		}
    	}else {
    		JOptionPane.showMessageDialog(this, "E-mail format is invalid.");
    	}
    }

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
        manageMembersBtn.setEnabled(false);
        manageMoviesBtn.setEnabled(false);
        jButton2.setEnabled(false);
        jButton1.setEnabled(true);
        jTextField1.setText("");
        jPasswordField1.setText("");
		jTextField1.setEnabled(true);
		jPasswordField1.setEnabled(true);
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Main().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPasswordField jPasswordField1;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JButton manageMembersBtn;
    private javax.swing.JButton manageMoviesBtn;
    // End of variables declaration
}

//import javax.swing.UIManager;
//
//public class Main extends javax.swing.JFrame {
//	private AllMovies allMovies;
//	private AllSimple allSimple;
//    /** Creates new form HomeScreen */
//    public Main() {
//    	try {
//			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//		} catch (Throwable e) {
//		}
//        initComponents();
//    }
//
//    /** This method is called from within the constructor to
//     * initialize the form.
//     * WARNING: Do NOT modify this code. The content of this method is
//     * always regenerated by the Form Editor.
//     */
//    @SuppressWarnings("unchecked")
//    // <editor-fold defaultstate="collapsed" desc="Generated Code">
//    private void initComponents() {
//
//        manageMembersBtn = new javax.swing.JButton();
//        jLabel1 = new javax.swing.JLabel();
//        manageMoviesBtn = new javax.swing.JButton();
//        
//        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
//        setTitle("Vido Library Management");
//
//        manageMembersBtn.setText("Manage members");
//        manageMembersBtn.addActionListener(new java.awt.event.ActionListener() {
//            public void actionPerformed(java.awt.event.ActionEvent evt) {
//                manageMembersBtnActionPerformed(evt);
//            }
//        });
//
//        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
//        jLabel1.setText("Video Library Management");
//
//        manageMoviesBtn.setText("Manage movies");
//        manageMoviesBtn.addActionListener(new java.awt.event.ActionListener() {
//            public void actionPerformed(java.awt.event.ActionEvent evt) {
//                manageMoviesBtnActionPerformed(evt);
//            }
//        });
//
//        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
//        getContentPane().setLayout(layout);
//        layout.setHorizontalGroup(
//            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(layout.createSequentialGroup()
//                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//                    .addGroup(layout.createSequentialGroup()
//                        .addGap(100, 100, 100)
//                        .addComponent(jLabel1))
//                    .addGroup(layout.createSequentialGroup()
//                        .addGap(117, 117, 117)
//                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
//                            .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
//                            .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))))
//                .addContainerGap(108, Short.MAX_VALUE))
//        );
//        layout.setVerticalGroup(
//            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
//                .addGap(34, 34, 34)
//                .addComponent(jLabel1)
//                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
//                .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addGap(18, 18, 18)
//                .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addGap(74, 74, 74))
//        );
//
//        pack();
//        this.setLocationRelativeTo(null);
//    }// </editor-fold>
//
//    private void manageMembersBtnActionPerformed(java.awt.event.ActionEvent evt) {
//        if(allSimple == null)
//        	new AllSimple().setVisible(true);
//    }
//
//    private void manageMoviesBtnActionPerformed(java.awt.event.ActionEvent evt) {
//        if(allMovies == null)
//        	new AllMovies().setVisible(true);
//    }
//
//    /**
//     * @param args the command line arguments
//     */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                new Main().setVisible(true);
//            }
//        });
//    }
//    // Variables declaration - do not modify
//    private javax.swing.JLabel jLabel1;
//    private javax.swing.JButton manageMembersBtn;
//    private javax.swing.JButton manageMoviesBtn;
//    // End of variables declaration
//}


//import java.rmi.RemoteException;
//import java.util.regex.Matcher;
//import java.util.regex.Pattern;
//
//import javax.swing.JOptionPane;
//import javax.swing.UIManager;
//
//import cmpe273.classproject.server.service.MovieServiceImplProxy;
//
//public class Main extends javax.swing.JFrame {
//    MovieServiceImplProxy proxy = new MovieServiceImplProxy();
//    /** Creates new form HomeScreen */
//    public Main() {
//    	try {
//		UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
//	} catch (Throwable e) {
//	}
//        initComponents();
//    }
//
//    /** This method is called from within the constructor to
//     * initialize the form.
//     * WARNING: Do NOT modify this code. The content of this method is
//     * always regenerated by the Form Editor.
//     */
//    @SuppressWarnings("unchecked")
//    // <editor-fold defaultstate="collapsed" desc="Generated Code">
//    private void initComponents() {
//
//        manageMembersBtn = new javax.swing.JButton();
//        jLabel1 = new javax.swing.JLabel();
//        manageMoviesBtn = new javax.swing.JButton();
//        jPasswordField1 = new javax.swing.JPasswordField();
//        jTextField1 = new javax.swing.JTextField();
//        jLabel2 = new javax.swing.JLabel();
//        jLabel3 = new javax.swing.JLabel();
//        jLabel4 = new javax.swing.JLabel();
//        jSeparator1 = new javax.swing.JSeparator();
//        jButton1 = new javax.swing.JButton();
//
//        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
//        setTitle("Video Library Management");
//
//        manageMembersBtn.setText("Manage members");
//        manageMembersBtn.setEnabled(false);
//        manageMembersBtn.addActionListener(new java.awt.event.ActionListener() {
//            public void actionPerformed(java.awt.event.ActionEvent evt) {
//                manageMembersBtnActionPerformed(evt);
//            }
//        });
//
//        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
//        jLabel1.setText("Video Library Management");
//
//        manageMoviesBtn.setText("Manage movies");
//        manageMoviesBtn.setEnabled(false);
//        manageMoviesBtn.addActionListener(new java.awt.event.ActionListener() {
//            public void actionPerformed(java.awt.event.ActionEvent evt) {
//                manageMoviesBtnActionPerformed(evt);
//            }
//        });
//
//        jLabel2.setText("Admin login");
//
//        jLabel3.setText("E-mail:");
//
//        jLabel4.setText("Password:");
//
//        jButton1.setText("Login");
//        jButton1.addActionListener(new java.awt.event.ActionListener() {
//            public void actionPerformed(java.awt.event.ActionEvent evt) {
//                jButton1ActionPerformed(evt);
//            }
//        });
//
//        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
//        getContentPane().setLayout(layout);
//        layout.setHorizontalGroup(
//            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(layout.createSequentialGroup()
//                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//                    .addGroup(layout.createSequentialGroup()
//                        .addGap(98, 98, 98)
//                        .addComponent(jLabel1))
//                    .addGroup(layout.createSequentialGroup()
//                        .addGap(106, 106, 106)
//                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
//                            .addComponent(jLabel4)
//                            .addComponent(jLabel3))
//                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
//                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
//                            .addComponent(jPasswordField1)
//                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
//                            .addComponent(jLabel2)
//                            .addComponent(jButton1, javax.swing.GroupLayout.Alignment.TRAILING)))
//                    .addGroup(layout.createSequentialGroup()
//                        .addGap(117, 117, 117)
//                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
//                            .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
//                            .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)))
//                    .addGroup(layout.createSequentialGroup()
//                        .addContainerGap()
//                        .addComponent(jSeparator1, javax.swing.GroupLayout.DEFAULT_SIZE, 398, Short.MAX_VALUE)))
//                .addContainerGap())
//        );
//        layout.setVerticalGroup(
//            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//            .addGroup(layout.createSequentialGroup()
//                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
//                    .addGroup(layout.createSequentialGroup()
//                        .addContainerGap()
//                        .addComponent(jLabel1)
//                        .addGap(25, 25, 25)
//                        .addComponent(jLabel2)
//                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
//                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
//                            .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
//                            .addComponent(jLabel3))
//                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
//                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
//                            .addComponent(jLabel4)
//                            .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
//                    .addGroup(layout.createSequentialGroup()
//                        .addGap(140, 140, 140)
//                        .addComponent(jButton1)))
//                .addGap(13, 13, 13)
//                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addGap(18, 18, 18)
//                .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addGap(22, 22, 22)
//                .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
//                .addContainerGap(30, Short.MAX_VALUE))
//        );
//
//        pack();
//    }// </editor-fold>
//
//    private void manageMembersBtnActionPerformed(java.awt.event.ActionEvent evt) {
//        new AllSimple().setVisible(true);
//    }
//
//    private void manageMoviesBtnActionPerformed(java.awt.event.ActionEvent evt) {
//        new AllMovies().setVisible(true);
//    }
//
//    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
//    	Pattern pEmailchecker = Pattern.compile("^[a-zA-Z0-9._%-]+@[a-zA-Z0-9._%-]+.[a-zA-Z]{2,6}$");
//    	Matcher m5 = pEmailchecker.matcher(jTextField1.getText());
//    	boolean emailchecker = m5.matches();
//    	if(emailchecker) {
//    	String pw = new String(jPasswordField1.getPassword());
//    	try {
//			if(proxy.login(jTextField1.getText(), pw)) {
//				manageMembersBtn.setEnabled(true);
//				manageMoviesBtn.setEnabled(true);
//			} else
//				JOptionPane.showMessageDialog(this, "Username (e-mail) or password was wrong.");
//		} catch (RemoteException e) {
//			JOptionPane.showMessageDialog(this, "Connection to server failed, try again later.");
//		}
//    	}else {
//    		JOptionPane.showMessageDialog(this, "E-mail format is invalid.");
//    	}
//    }
//
//    /**
//     * @param args the command line arguments
//     */
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            public void run() {
//                new Main().setVisible(true);
//            }
//        });
//    }
//    // Variables declaration - do not modify
//    private javax.swing.JButton jButton1;
//    private javax.swing.JLabel jLabel1;
//    private javax.swing.JLabel jLabel2;
//    private javax.swing.JLabel jLabel3;
//    private javax.swing.JLabel jLabel4;
//    private javax.swing.JPasswordField jPasswordField1;
//    private javax.swing.JSeparator jSeparator1;
//    private javax.swing.JTextField jTextField1;
//    private javax.swing.JButton manageMembersBtn;
//    private javax.swing.JButton manageMoviesBtn;
//    // End of variables declaration
//}
//
//
//
////import javax.swing.UIManager;
////
////public class Main extends javax.swing.JFrame {
////	private AllMovies allMovies;
////	private AllSimple allSimple;
////    /** Creates new form HomeScreen */
////    public Main() {
////    	try {
////			UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
////		} catch (Throwable e) {
////		}
////        initComponents();
////    }
////
////    /** This method is called from within the constructor to
////     * initialize the form.
////     * WARNING: Do NOT modify this code. The content of this method is
////     * always regenerated by the Form Editor.
////     */
////    @SuppressWarnings("unchecked")
////    // <editor-fold defaultstate="collapsed" desc="Generated Code">
////    private void initComponents() {
////
////        manageMembersBtn = new javax.swing.JButton();
////        jLabel1 = new javax.swing.JLabel();
////        manageMoviesBtn = new javax.swing.JButton();
////        
////        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
////        setTitle("Vido Library Management");
////
////        manageMembersBtn.setText("Manage members");
////        manageMembersBtn.addActionListener(new java.awt.event.ActionListener() {
////            public void actionPerformed(java.awt.event.ActionEvent evt) {
////                manageMembersBtnActionPerformed(evt);
////            }
////        });
////
////        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
////        jLabel1.setText("Video Library Management");
////
////        manageMoviesBtn.setText("Manage movies");
////        manageMoviesBtn.addActionListener(new java.awt.event.ActionListener() {
////            public void actionPerformed(java.awt.event.ActionEvent evt) {
////                manageMoviesBtnActionPerformed(evt);
////            }
////        });
////
////        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
////        getContentPane().setLayout(layout);
////        layout.setHorizontalGroup(
////            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
////            .addGroup(layout.createSequentialGroup()
////                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
////                    .addGroup(layout.createSequentialGroup()
////                        .addGap(100, 100, 100)
////                        .addComponent(jLabel1))
////                    .addGroup(layout.createSequentialGroup()
////                        .addGap(117, 117, 117)
////                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
////                            .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE)
////                            .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 169, javax.swing.GroupLayout.PREFERRED_SIZE))))
////                .addContainerGap(108, Short.MAX_VALUE))
////        );
////        layout.setVerticalGroup(
////            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
////            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
////                .addGap(34, 34, 34)
////                .addComponent(jLabel1)
////                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE)
////                .addComponent(manageMembersBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
////                .addGap(18, 18, 18)
////                .addComponent(manageMoviesBtn, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
////                .addGap(74, 74, 74))
////        );
////
////        pack();
////        this.setLocationRelativeTo(null);
////    }// </editor-fold>
////
////    private void manageMembersBtnActionPerformed(java.awt.event.ActionEvent evt) {
////        if(allSimple == null)
////        	new AllSimple().setVisible(true);
////    }
////
////    private void manageMoviesBtnActionPerformed(java.awt.event.ActionEvent evt) {
////        if(allMovies == null)
////        	new AllMovies().setVisible(true);
////    }
////
////    /**
////     * @param args the command line arguments
////     */
////    public static void main(String args[]) {
////        java.awt.EventQueue.invokeLater(new Runnable() {
////
////            public void run() {
////                new Main().setVisible(true);
////            }
////        });
////    }
////    // Variables declaration - do not modify
////    private javax.swing.JLabel jLabel1;
////    private javax.swing.JButton manageMembersBtn;
////    private javax.swing.JButton manageMoviesBtn;
////    // End of variables declaration
////}
